package com.baidu.ota.services;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import com.baidu.otasdk.ota.Constants;

/**
 * 唤醒APP的服务，当app设置为无UI时，外部可start此服务来唤醒
 * 唤醒代码：
 * Intent intent = new Intent("ota.baidu.action.launch");
 * intent.setPackage(applicationId); applicationId为build.gradle中配置的applicationId
 * startService(intent);
 */
public class LaunchService extends Service {

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i(Constants.TAG, "launch service");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
